<?php
include_once(_APP_PATH. 'modules/admin/controllers/media/media_admin_http.php');
class media_admin_std_cli extends media_admin_http
{ 
    /**
		экшен по-умолчанию
	*/
    public function PrAction ()
    {
        $this->confirm_filePr();
    }  

    public function confirm_filePrAction()
    {
    	$code = $this->Request()->get('code');
    	if ($this->GetMediaMapper()->ApproveMediaByCode($code))
    	{
    		$response = 'Media file approved'; 
    	}
    	else
    	{
    	    if ($this->GetMediaMapper()->IsError())
        	{
        		$response = $this->GetMediaMapper()->GetErrorMessage();
        	}
        	else
        	{
				$response = 'Error occured with media file';		                		
        	}    		
    	}
    	
    	$this->Response()->SetBody($response);
    }
}